package com.mentalhealthplatform.schoolV1.controller;

import com.mentalhealthplatform.schoolV1.dto.AssessmentDTO;
import com.mentalhealthplatform.schoolV1.service.AssessmentServiceV1;
import com.mentalhealthplatform.utils.stringUtils.ConvertEmptyToNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/assessments")
public class AssessmentControllerV1 {

    @Autowired
    private AssessmentServiceV1 assessmentServiceV1;

    // 获取评估数据，根据过滤条件
    @GetMapping
    public List<AssessmentDTO> getAssessments(
            @RequestParam(required = false) @ConvertEmptyToNull String dateRange,
            @RequestParam(required = false) @ConvertEmptyToNull String evaluation) {
        return assessmentServiceV1.getAssessments(dateRange, evaluation);
    }
}
